/*
 * ConcreteHardwareController.hpp
 *
 *  Created on: 13 dec. 2012
 *      Author: Admin
 */

#ifndef CONCRETEHARDWARECONTROLLER_HPP_
#define CONCRETEHARDWARECONTROLLER_HPP_

#include "HardwareController.hpp"

/**
 * The HardwareController connects the robot's software to its hardware and is the central point for polling sensors and controlling actuators.
 *
 * This class also contains the software representation of the hardware PIN configuration.
 *
 */
class ConcreteHardwareController : public HardwareController
{
public:
	/**
	 * Retrieve the HardwareController INSTANCE
	 */
	static HardwareController& getHardwareController();

	virtual ~ConcreteHardwareController();

	/**
	 * Polls the light sensor on the left side of the color lane
	 */
	virtual bool pollColorlaneLeft();

	/**
	 * Polls the light sensor on the right side of the color lane
	 */
	virtual bool pollColorlaneRight();


	/**
	 * Polls the CollisionSensor mounted on the backside of the robot
	 */
	virtual bool pollCollisionSensorBack();

	/**
	 * Polls the CollisionSensor mounted on the frontside of the robot
	 */
	virtual bool pollCollisionSensorFront();

	/**
	 * Polls the CrossroadsSenser
	 */
	virtual bool pollCrossRoadsSensor();

	/**
	 * Polls the DistanceSensor
	 */
	virtual bool pollDistanceSensor();

	/**
	 * Polls the EmergencyStop
	 */
	virtual bool pollEmergencyStop();

	/**
	 * Activates the wheels (enables the brick control actuator)
	 */
	virtual void activateWheels();

	/**
	 * Disables the wheels (disables the brick control actuator)
	 */
	virtual void disableWheels();

	/**
	 * Activates the LED
	 */
	virtual void activateLED();

	/**
	 * Disables the LED
	 */
	virtual void disableLED();

	/**
	 * Makes the left wheel turn forward
	 */
	virtual void leftWheelForward();

	/**
	 * Makes the left wheel turn backward
	 */
	virtual void leftWheelBackward();

	/**
	 * Makes the right wheel turn forward
	 */
	virtual void rightWheelForward();

	/**
	 * Makes the right wheel turn backward
	 */
	virtual void rightWheelBackward();

	/**
	 * Wait a certain amount of ms
	 * @param ms amount of milliseconds the robot should wait
	 */
	virtual void wait(unsigned int ms);

	/**
	 * Wait a certain amount of ms and decrements the given paramater
	 * @param ms amount of milliseconds the robot should wait, this value will be decremented by 1 for every ms that has passed
	 */
	virtual void wait(unsigned int* ms);
private:
	ConcreteHardwareController();
};

#endif /* CONCRETEHARDWARECONTROLLER_HPP_ */
